<script lang="ts" setup>
import { ref, watch } from 'vue'
const time = ref('')
function runtime(){
        // 初始时间，日/月/年 时:分:秒
      let  X = new Date("08/28/2022 04:18:16");
      let  Y = new Date();
      let  T = (Y.getTime()-X.getTime());
      let  M = 24*60*60*1000;
      let  a = T/M;
      let  A = Math.floor(a);
      let  b = (a-A)*24;
      let  B = Math.floor(b);
      let  c = (b-B)*60;
      let  C = Math.floor((b-B)*60);
      let  D = Math.floor((c-C)*60);
        //信息写入到DIV中
        time.value = "本站勉强运行: "+A+"天"+B+"小时"+C+"分"+D+"秒"
    }
    setInterval(runtime, 1000);
</script>

<template>
    <div class="footer">
        <div>Copyright  © 2022 - 2023 </div>
        <div>{{ time }}</div>
    </div>
</template>

<style lang="scss" scoped>
.footer{
    border-top: solid 1px var(--el-menu-border-color);
    color: var(--el-text-color-primary);
    height: 30%;
    padding: 10px 0;
    div{
        text-align: center;
    }
}
</style>